<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/admin/lib/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/admin/css/public.css" media="all"/>
    <link rel="stylesheet" href="/admin/lib/editormd/css/editormd.min.css">
    <style>
        .column2 {
            width: 50%;
        }

        .editormd-dialog-container select {
            display: inline;
        }

        .category .layui-form-label {
            width: 70px;
            padding: 9px 1px;
        }

        .layui-btn + .layui-btn {
            margin-left: 0px;
        }

        .layui-btn.layui-btn-sm.layui-btn-normal.Ms-labe-box {
            margin-right: 5px;
            margin-top: 5px;
        }

        .layui-btn.layui-btn-sm.layui-btn-primary.Ms-labe-backstageBtn {
            margin-right: 5px;
            margin-top: 5px;

        }

    </style>
</head>
<body class="childrenBody">


@if(isset($article))

    <form class="layui-form layui-row layui-col-space10" action="/admin/article/store?id={{$article->id}}"
          method="post">
        @else
            <form class="layui-form layui-row layui-col-space10" action="{{route('article.store')}}" method="post">
                @endif

                <div class="layui-col-md8 layui-col-xs12">
                    <div class="layui-row layui-col-space10">
                        <div class="layui-col-md8 layui-col-xs7">
                            <div class="layui-form-item magt3">
                                <label class="layui-form-label">文章标题</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input newsName" id="title" name="title"
                                           lay-verify="newsName" placeholder="请输入文章标题">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">内容摘要</label>
                                <div class="layui-input-block">
                                    <textarea placeholder="请输入内容摘要" name="keywords" id="keywords"
                                              class="layui-textarea abstract"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md3 layui-col-xs5">
                            <div class="layui-upload-list thumbBox mag0 magt3">
                                <img class="layui-upload-img thumbImg" id="srcimgurl">
                                <input type="hidden" name="cover" id="conver">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item magb0">
                        <label class="layui-form-label">文章内容</label>
                        <div class="layui-input-block" id="bjy-content">
				<textarea name="content" id="content">
					@if(isset($article))
                        {{$article->markdown}}
                    @endif
				</textarea>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4 layui-col-xs12">
                    <div>
                        <div class="layui-col-xs6 layui-col-md12">
                            <blockquote class="layui-elem-quote title"><i class="seraph icon-caidan"></i> 分类目录
                            </blockquote>
                            <div class="layui-col-xs12 border category">
                                <div class="">
                                    @foreach($type_list as $key=>$item)
                                        <div class="layui-col-md12 layui-col-xs4">
                                            @if($key==0)
                                                <input type="radio" id="type_id" name="type_id" value="{{$item->id}}"
                                                       title="{{$item->title}}" lay-skin="primary"/>
                                            @else
                                                <input type="radio" id="type_id" name="type_id" value="{{$item->id}}"
                                                       title="{{$item->title}}" lay-skin="primary"/>
                                            @endif
                                        </div>
                                    @endforeach
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-xs6 layui-col-md12">
                            <blockquote class="layui-elem-quote title"><i class="seraph icon-caidan"></i> 标签目录
                            </blockquote>
                            <div class="layui-col-xs12 border category">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">标签：</label>
                                    <div class="layui-input-inline">
                                        <input type="text" autocomplete="off" class="layui-input Ms-labe-addinput">
                                    </div>
                                    <button class="layui-btn  Ms-labe-addbtn" style="padding: 0 10px">添加</button>
                                </div>


                                <div class="layui-form-item">
                                    <label class="layui-form-label">已选标签：</label>
                                    <div class="layui-input-block  Ms-labe-inner"></div>
                                    <input type="hidden" name="tag_ids" id="tag_ids" value=""
                                           class="Ms-labe-innerHidden">
                                </div>

                                <div class="layui-form-item  ">
                                    <label class="layui-form-label">推荐标签：</label>
                                    <div class="layui-input-block  Ms-labe-backstage">
                                        @foreach($tag_list as $item)
                                            <button class="layui-btn layui-btn-sm layui-btn-primary  Ms-labe-backstageBtn"
                                                    data-id="{{$item->id}}">{{$item->name}}</button>
                                        @endforeach
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs12">
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend>操作</legend>
                        </fieldset>
                        {{--<blockquote class="layui-elem-quote title magt10"><i class="layui-icon">&#xe609;</i> 发布</blockquote>--}}
                        <div class="border">
                            <div class="layui-form-item">
                                <label class="layui-form-label"><i class="layui-icon">&#xe60e;</i> 状　态</label>
                                <div class="layui-input-block newsStatus">
                                    <select name="status" id="status" lay-verify="required">
                                        <option value="0">保存草稿</option>
                                        <option value="1">等待审核</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label"><i class="layui-icon">&#xe609;</i> 发　布</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="release" title="立即发布" lay-skin="primary"
                                           lay-filter="release" checked/>
                                    <input type="radio" name="release" title="定时发布" lay-skin="primary"
                                           lay-filter="release"/>
                                </div>
                            </div>
                            <div class="layui-form-item layui-hide releaseDate">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="release" placeholder="请选择日期和时间"
                                           readonly/>
                                </div>
                            </div>
                            <div class="layui-form-item openness">
                                <label class="layui-form-label"><i class="seraph icon-look"></i> 公开度</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="openness" id="openness" value="1" title="开放浏览"
                                           lay-skin="primary" checked/>
                                    <input type="radio" name="openness" id="openness" value="0" title="私密浏览"
                                           lay-skin="primary"/>
                                </div>
                            </div>
                            <div class="layui-form-item newsTop">
                                <label class="layui-form-label"><i class="seraph icon-zhiding"></i> 置　顶</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" name="is_top" id="is_top" value="1" lay-skin="switch"
                                           lay-text="是|否">
                                </div>
                            </div>
                            <hr class="layui-bg-gray"/>
                            <div class="layui-right">
                                <a class="layui-btn layui-btn-sm" lay-filter="addNews" lay-submit=""><i
                                            class="layui-icon">&#xe609;</i>发布</a>
                                <a class="layui-btn layui-btn-primary layui-btn-sm" lay-filter="look" lay-submit>预览</a>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

            <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
            <script type="text/javascript" src="/admin/lib/layui/layui.js"></script>
            <script type="text/javascript" src="/admin/js/article/newsAdd.js"></script>
            <script type="text/javascript" src="/admin/lib/editormd/editormd.min.js"></script>
            <script type="text/javascript" src="/admin/js/article/extend.js"></script>


</body>

</html>
